<%-- 
    Document   : pagreg_8
    Created on : Jun 21, 2013, 3:40:44 PM
    Author     : Rómulo Galindo
--%>
<%@page import="acceso.util.Departamento"%>
<%@page import="java.util.HashMap"%>
<%@page import="java.util.Map"%>
<%@page import="java.util.ArrayList"%>
<%@page import="java.util.List"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>

<!DOCTYPE html>
<!--VARIABLES / PARAMETROS-->
<c:set scope="page" var="ti_pagina" value="${param.ti_pagina}" />
<c:set scope="page" var="ti_pagreg" value="${param.ti_pagreg}" />
<c:set scope="page" var="ti_estreg" value="${param.ti_estreg}" />
<c:set scope="page" var="va_pagreg" value="${param.va_pagreg}" />
<c:set scope="page" var="id_pagreg" value="${param.id_pagreg}" />
<!--EXTRAS-->
<c:set scope="page" var="co_pagina" value="${param.co_pagina}" />
<c:set scope="page" var="co_vuelta" value="${param.co_vuelta}" />
<c:set scope="page" var="co_pagreg" value="${param.co_pagreg}" />
<!--METODOS-->
<!--VISUALIZACIÓN-->
<%--<c:if test="${ti_pagina =='R'}">--%>
<input type="hidden" id="${id_pagreg}" class="q" value="${paginaBean.geo.lat}/${paginaBean.geo.lng}"/>
<c:if test="${(ti_estreg == 'E')}" >
    <div id="x${id_pagreg}" class="georeferencia">
        <img id="i${id_pagreg}" width="100%" height="120px" />
        <label id="t${id_pagreg}"></label>
    </div>
    <script>
        try {
            options_gson['geo${id_pagreg}'] = JSON.parse($D.g_ID('${id_pagreg}').value);
        } catch (e) {
            $D.g_ID('${id_pagreg}').value = "{\"no_latitud\":0.0,\"no_longitud\":0.0,\"ca_radio\":1000,\"no_modo\":\"popup\",\"no_type\":1,\"no_descripcion\":1}";
            options_gson['geo${id_pagreg}'] = JSON.parse($D.g_ID('${id_pagreg}').value);
        }
        $D.g_ID('x${id_pagreg}').setAttribute("onclick", "VG_N('${id_pagreg}',true)");
        $D.g_ID('t${id_pagreg}').innerHTML = (options_gson['geo${id_pagreg}'].no_latitud == "0.0") ? "Agregar" : "Ver / Editar";
        $D.g_ID('i${id_pagreg}').src = "http://maps.googleapis.com/maps/api/staticmap?zoom=15&size=370x120&center=" + options_gson['geo${id_pagreg}'].no_latitud + "," + options_gson['geo${id_pagreg}'].no_longitud + "&markers=color:red|" + options_gson['geo${id_pagreg}'].no_latitud + "," + options_gson['geo${id_pagreg}'].no_longitud + "";
    </script>
</c:if>

<c:if test="${(ti_estreg == 'L')}" >
    <c:if test="${(not empty va_pagreg)}">
        <div id="x${id_pagreg}" class="georeferencia">
            <img id="i${id_pagreg}" width="100%" height="120px" />
            <label id="t${id_pagreg}"></label>
        </div>
        <script>
            try {
                options_gson['geo${id_pagreg}'] = JSON.parse($D.g_ID('${id_pagreg}').value);
            } catch (e) {
                $D.g_ID('${id_pagreg}').value = "{\"no_latitud\":0.0,\"no_longitud\":0.0,\"ca_radio\":1000,\"no_modo\":\"popup\",\"no_type\":1,\"no_descripcion\":1}";
                options_gson['geo${id_pagreg}'] = JSON.parse($D.g_ID('${id_pagreg}').value);
            }
            $D.g_ID('x${id_pagreg}').setAttribute("onclick", "VG_N('${id_pagreg}',false)");
            $D.g_ID('t${id_pagreg}').innerHTML = "Ver";
            $D.g_ID('i${id_pagreg}').src = "http://maps.googleapis.com/maps/api/staticmap?zoom=15&size=370x120&center=" + options_gson['geo${id_pagreg}'].no_latitud + "," + options_gson['geo${id_pagreg}'].no_longitud + "&markers=color:red|" + options_gson['geo${id_pagreg}'].no_latitud + "," + options_gson['geo${id_pagreg}'].no_longitud + "";
        </script>
    </c:if>
</c:if>